/**
 * 
 */

package com.shy.portal.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.stereotype.Service;

import com.shy.base.service.impl.BaseServiceImpl;
import com.shy.portal.dao.UserRoleDao;
import com.shy.portal.entity.UserRole;
import com.shy.portal.service.UserRoleService;

/**
 * <p>
 * Title:UserRoleServiceImpl
 * </p>
 * <p>
 * Description:
 * </p>
 * <p>
 * Company:ipebg
 * </p>
 * 
 * @author H2013788
 */
@Service("userRoleService")
public class UserRoleServiceImpl extends BaseServiceImpl<UserRole> implements UserRoleService {

	/**
     * log
     */
	private Logger logger = LogManager.getLogger(this.getClass());

    /**
     * 用户角色dao
     */
    @Resource
    private UserRoleDao userRoleDao;

    /**
     * 
     * @param userRoleDao 用户角色dao
     * @author H2201965
     * @date 2018/2/6下午3:45:36
     */
    @Resource
    protected void setBaseDao(UserRoleDao userRoleDao) {
        this.baseDao = userRoleDao;
    }

    @Override
    public boolean batchSaveUserRole(List<UserRole> list, Integer userId) throws Exception {
        try {
            return userRoleDao.batchSaveUserRole(list, userId);
        } catch (Exception e) {
            e.printStackTrace();
            logger.error("batch save UserRole error : " + e);
            throw e;
        }
    }

}
